/*
 * @Author: your name
 * @Date: 2021-11-12 09:52:18
 * @LastEditTime: 2021-11-15 18:34:46
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\admin\src\utils\addBreadcrumbData.js
 */
let list = [];
const addBreadcrumbData = (data, pathname) => {
    if (pathname == "/workbench") return;
    data.forEach((item) => {
        if (item.path == pathname) {
            list.push(item);
        } else {
            if (item.children) {
                addBreadcrumbData(item.children, pathname);
            }
        }
    });
    if (list.length > 1) {
        list.splice(0, 1);
    }
    return list;
};
export default addBreadcrumbData;